package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.devicecontroller;

import java.util.Date;




import net.wimpi.modbus.procimg.DigitalIn;
import net.wimpi.modbus.procimg.DigitalOut;
import net.wimpi.modbus.procimg.IllegalAddressException;
import net.wimpi.modbus.procimg.InputRegister;
import net.wimpi.modbus.procimg.Register;

public interface ProcessImageDated  {
	  
	   /* ************************************************
	    *  DIGITAL-OUT METHODS 
	    **************************************************/

	  /**
	   * Returns the <tt>DigitalOut</tt> instance at the given
	   * reference.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>DigitalOut</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public DigitalOut getDigitalOut(int ref)
	      throws IllegalAddressException;

	  /**
	   * Returns the number of <tt>DigitalOut</tt> instances
	   * in this <tt>ProcessImage</tt>.
	   *
	   * @return the number of digital outs as <tt>int</tt>.
	   */
	  public int getDigitalOutCount();

	  /**
	   * Sets a new <tt>DigitalOut</tt> instance at the
	   * given reference.
	   *
	   * @param ref digital out index as <tt>int</tt>.
	   * @param value digital out index value.
	   * @param date date to be set as value setting date
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public void setDigitalOut(int ref, DigitalOut value, Date date)
	      throws IllegalAddressException;

	  /**
	   * Returns the <tt>Date</tt> instance at the given
	   * reference. It contains last update date.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>Date</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public Date getDigitalOutDate(int ref)
	      throws IllegalAddressException;

	  /* ************************************************
	    *  DIGITAL-IN METHODS 
	    **************************************************/

	  /**
	   * Returns the <tt>DigitalIn</tt> instance at the given
	   * reference.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>DigitalIn</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public DigitalIn getDigitalIn(int ref)
	      throws IllegalAddressException;

	  /**
	   * Returns the number of <tt>DigitalIn</tt> instances
	   * in this <tt>ProcessImage</tt>.
	   *
	   * @return the number of digital ins as <tt>int</tt>.
	   */
	  public int getDigitalInCount();

	  /**
	   * Sets a new <tt>DigitalOut</tt> instance at the
	   * given reference.
	   *
	   * @param ref digital in index as <tt>int</tt>.
	   * @param value digital in index value.
	   * @param date date to be set as value setting date
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public void setDigitalIn(int ref, DigitalIn value, Date date)
	      throws IllegalAddressException;

	  /**
	   * Returns the <tt>Date</tt> instance at the given
	   * reference. It contains last update date.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>Date</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public Date getDigitalInDate(int ref)
	      throws IllegalAddressException;

	  /* ************************************************
	    *  INPUT-REGISTER METHODS 
	    **************************************************/

	  /**
	   * Returns the <tt>InputRegister</tt> instance at the given
	   * reference.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>InputRegister</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public InputRegister getInputRegister(int ref)
	      throws IllegalAddressException;

	  /**
	   * Returns the number of <tt>InputRegister</tt> instances
	   * in this <tt>ProcessImage</tt>.
	   *
	   * @return the number of input registers as <tt>int</tt>.
	   */
	  public int getInputRegisterCount();
	  
	  /**
	   * Sets a new <tt>DigitalOut</tt> instance at the
	   * given reference.
	   *
	   * @param ref input register index as <tt>int</tt>.
	   * @param value input register index value.
	   * @param date date to be set as value setting date
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public void setInputRegister(int ref, InputRegister value, Date date)
	      throws IllegalAddressException;
	  
	  /**
	   * Returns the <tt>Date</tt> instance at the given
	   * reference.  It contains last update date.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>Date</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public Date getInputRegisterDate(int ref)
	      throws IllegalAddressException;
	  
	  /* ************************************************
	    *  REGISTER METHODS 
	    **************************************************/

	  /**
	   * Returns the <tt>InputRegister</tt> instance at the given
	   * reference.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>InputRegister</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public InputRegister getRegister(int ref)
	      throws IllegalAddressException;

	  /**
	   * Returns the number of <tt>InputRegister</tt> instances
	   * in this <tt>ProcessImage</tt>.
	   *
	   * @return the number of input registers as <tt>int</tt>.
	   */
	  public int getRegisterCount();

	  /**
	   * Sets a new <tt>DigitalOut</tt> instance at the
	   * given reference.
	   *
	   * @param ref register index as <tt>int</tt>.
	   * @param value register index value.
	   * @param date date to be set as value setting date
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public void setRegister(int ref ,Register value ,Date date )
	      throws IllegalAddressException;

	  /**
	   * Returns the <tt>Date</tt> instance at the given
	   * reference.  It contains last update date.
	   * <p>
	   *
	   * @param ref the reference.
	   *
	   * @return the <tt>Date</tt> instance at the given address.
	   *
	   * @throws IllegalAddressException if the reference is invalid.
	   */
	  public Date getRegisterDate(int ref)
	      throws IllegalAddressException;

}
